package random.fox.p2p.model;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;
import random.fox.p2p.AppModule;
import random.fox.p2p.interactors.MessageInteractor;
import random.fox.p2p.presenter.SendMessagePresenter;
import random.fox.p2p.presenter.SendMessagePresenterImpl;
import random.fox.p2p.ui.SendMessageView;
import random.fox.p2p.view.IMessageView;

/**
 * Created by delong on 2015/3/24.
 */

@Module(
        injects = {
                SendMessageView.class,
        },
        addsTo = AppModule.class
)
public class SendMessageModule {

    IMessageView iMessageView;

    public SendMessageModule(IMessageView iMessageView){
        this.iMessageView = iMessageView;
    }

    @Provides
    @Singleton
    IMessageView provideIMessageView(){
        return iMessageView;
    }


    @Provides @Singleton
    SendMessagePresenter provideNewMessagePresenter(IMessageView iMessageView,MessageInteractor interactor){
        return new SendMessagePresenterImpl(iMessageView,interactor);
    }
}
